package com.ftg.exam.manage.mapper;

import com.ftg.exam.manage.pojo.Difficulties;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author zwl
 * Create on 2019/9/2 15:37
 * function
 */
@Mapper
public interface DifficultiesMapper {

    @Select("select * from difficulties where pid is null")
    public Difficulties showall();

    @Update("update difficulties set difficulties=#{difficulties},pid=#{pid} where id=#{id}")
    public int update(Difficulties difficulties);

    @Delete("delete from difficulties where id=#{id}")
    public int delete(String id);

    @Insert("insert into difficulties(difficulties,pid) values(#{difficulties},#{pid})")
    public int save(Difficulties difficulties);
    @Select("select * from difficulties where pid=#{pid}")
    List<Difficulties> childDifficulties(int pid);
}
